package com.hands.commen.entity.domain;

import lombok.Data;

import java.io.Serializable;

@Data
public class MessageInfo<T> implements Serializable {
    private int statusCode;
    private String message;
    private T result;


    /**
     *
     * @param result
     * @return
     */
    public static MessageInfo ofsuccess(Object result){
        MessageInfo msg = new MessageInfo();
        msg.setStatusCode(200);
        msg.setMessage("处理成功");
        msg.setResult(result);
        return msg;
    }

    public static MessageInfo isSuccess(int statusCode,String message,Object result){
        MessageInfo msg = new MessageInfo();
        msg.setStatusCode(statusCode);
        msg.setMessage(message);
        msg.setResult(result);
        return msg;
    }

}
